/* 
 * Copyright (c) 2009 Keith Lazuka
 * License: http://www.opensource.org/licenses/mit-license.html
 */

#import <UIKit/UIKit.h>
#define kTitleViewHeigh 44.f
#define kTitleViewWidth 320.f
#define kButtonViewHeigh 35.f
#define kButtonViewWidth 320.f
@class KalViewControllerCellWrapper;
@interface KalViewControllerCellWrapper : NSObject
@property (nonatomic, retain) NSString* cellAddress;
@property (nonatomic, retain) NSString* cellPhoneNumber;
@property (nonatomic, retain) UILabel* cellAccessory;
-(id)initWithAddress:(NSString*)address andPhoneNumber:(NSString*)phoneNumber;
@end

@class KalGridView, KalLogic, KalDate;
@protocol KalViewDelegate, KalDataSourceCallbacks;
@interface KalView : UIView<UITableViewDataSource, UITableViewDelegate>
{
    UIView* _titleView;
    UIView* _buttonView;
    UIView* _contentView;
    UIView* _contentSubview;
    UIButton* _calendarButton;
    UIButton* _productionButton;
    UITableView *_tableView;
    NSMutableArray *_tableData;
//  UILabel *headerTitleLabel;
    
  KalGridView *gridView;
  UIImageView *shadowView;
  id<KalViewDelegate> delegate;
  KalLogic *logic;
}
@property (nonatomic,retain) UITableView *_tableView;
@property (nonatomic, assign) id<KalViewDelegate> delegate;
@property (nonatomic, readonly) KalDate *selectedDate;
@property (nonatomic, retain) NSMutableArray *tableData;
- (id)initWithFrame:(CGRect)frame delegate:(id<KalViewDelegate>)delegate logic:(KalLogic *)logic;
- (BOOL)isSliding;
- (void)selectDate:(KalDate *)date;
- (void)markTilesForDates:(NSArray *)dates;
- (void)redrawEntireMonth;
-(void)doSelectCalendar:(id)sender;
-(void)doSelectProduction:(id)sender;

// These 3 methods are exposed for the delegate. They should be called 
// *after* the KalLogic has moved to the month specified by the user.
- (void)slideDown;
- (void)slideUp;
- (void)jumpToSelectedMonth;    // change months without animation (i.e. when directly switching to "Today")

@end

#pragma mark -

@class KalDate;

@protocol KalViewDelegate

- (void)showPreviousMonth;
- (void)showFollowingMonth;
- (void)didSelectDate:(KalDate *)date;

@end
